This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
Sub Initialize
Dim Session As New NotesSession
Dim CurrDb As NotesDatabase
Dim NamesDb As NotesDatabase
Dim MailQuotaView As NotesView
Dim QuotaDoc As NotesDocument
Dim MailQuotaResults As Variant
' Error Handler
On Error Goto Error_Handler
Set CurrDb = Session.CurrentDatabase
Set NamesDb = New NotesDatabase(CurrDb.Server, "names.nsf")
If Not NamesDb.IsOpen Then
Messagebox "The address book could not be found.", 0+16, "Address Book Not Found"
Exit Sub
End If
Set MailQuotaView = NamesDb.GetView("($MailFileQuotaView)")
If MailQuotaView Is Nothing Then
Messagebox "The $MailFileQuotaView could not be found in the address book.", 0+16, "Expected View Not Found"
Exit Sub
End If
Set QuotaDoc = MailQuotaView.GetDocumentByKey(Session.CommonUserName, True)
If QuotaDoc Is Nothing Then
Messagebox "A quota document could not be found for " & Session.CommonUserName & ".", 0+48, "Quota Document Not Found"
Exit Sub
End If
MailQuotaResults = QuotaDoc.QuotaValue(0) ' Change field name to correct quota field name in your document
Messagebox "The quota for " & Session.CommonUserName & " is " & Trim(Cstr(MailQuotaResults)) & ".", 0+64, "Quota for " & Session.CommonUserName
Exit Sub
Error_Handler:
Print "An error has occurred on line " & Trim(Cstr(Erl)) & ": " & Error$ & " (" & Trim(Cstr(Err)) & ")"
Exit Sub
End Sub
Feedback response number WEBB7V89Y4 created by ~Lorraine Nimjipyburakol on 08/24/2009